<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="采购订单列表" bodyClass="gray-bg animated fadeInRight" isAnimation="false" libs=["table","zTree","layout-latest"]/>
<div class="container-div">
 <div class="row">
  <div class="col-sm-12 search-collapse">
    <@form.form id="purchase-form" class="form-inline">
     <div class="select-list">
      <ul>
           <li>
              <label> <@ctx.i18n text = "订单号"/>：
               <input type="text" name="saleCode"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "销售员"/>：
               <input type="text" name="saleUserid"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "销售订单编号"/>：
               <input type="text" name="saleOrderNumber"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "合同价格"/>：
               <input type="text" name="orderContractPrice"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "是否含税"/>： </label>
                <select name="orderIsTax" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_isOrNo')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "是否包含运输费用"/>：
               <input type="text" name="orderIsTransport"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "是否保修"/>：
               <input type="text" name="orderIsGuarantee"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "其他"/>：
               <input type="text" name="orderOtherItem"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "车辆识别号"/>：
               <input type="text" name="carVin"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "车辆"/>：
               <input type="text" name="carVehicle"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "里程"/>：
               <input type="text" name="carMileage"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "变速箱 "/>： </label>
                <select name="carTranmission" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_cartranmission')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "驱动形式"/>： </label>
                <select name="carDrivertrain" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_cardrivertrain')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "车况"/>： </label>
                <select name="carStatus" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_carstatus')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "采购来源"/>： </label>
                <select name="channelPurchaseSource" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_purchasesource')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "是否公开销售"/>： </label>
                <select name="channelIsOpenSale" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_isOrNo')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "拍卖 "/>： </label>
                <select name="channelAuction" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_auction')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "拍卖类型"/>： </label>
                <select name="channelAuctionType" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_auctiontype')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "拍卖时间类型"/>：
               <input type="text" name="channelAuctionTimeType"/> </label>
            </li>
          <li class="select-time">
             <label> <@ctx.i18n text = "拍卖时间"/>： </label>
            <input type="text" class="time-input" name="ChannelAuctionTime"/>
        </li>
           <li>
              <label> <@ctx.i18n text = "卖方名称"/>：
               <input type="text" name="channelSellerName"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "卖方联系方式"/>：
               <input type="text" name="channelSellerContactinfo"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "采购专员"/>：
               <input type="text" name="managerPurchaseSpecialist"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "是否采购"/>： </label>
                <select name="managerIsPurchase" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_isOrNo')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "采购结果"/>： </label>
                <select name="purchaseResult" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_result_status')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
          <li class="select-time">
             <label> <@ctx.i18n text = "结果时间"/>： </label>
            <input type="text" class="time-input" name="PurchaseResultTime"/>
        </li>
           <li>
                 <label> <@ctx.i18n text = "是否入库"/>： </label>
                <select name="isWarehousing" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_isOrNo')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
          <li class="select-time">
             <label> <@ctx.i18n text = "付款发送日期"/>： </label>
            <input type="text" class="time-input" name="CashierPaySentTime"/>
        </li>
           <li>
                 <label> <@ctx.i18n text = "付款方式"/>： </label>
                <select name="cashierPayMethod" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_paymethod')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "证明"/>：
               <input type="text" name="cashierProofFilepath"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "收据单号"/>：
               <input type="text" name="cashierReceiptNumber"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "支付结果"/>： </label>
                <select name="confirmPayMethod" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_result_status')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "金额"/>：
               <input type="text" name="confirmPayAmount"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "付款总额"/>：
               <input type="text" name="purchasePaySum"/> </label>
            </li>
        <li>
          <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
          <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
       </li>
      </ul>
   </div>
  </@form.form>
 </div>
  <@table id="bootstrap-table">
    <@shiro.hasPermission name="bpm:purchase:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:purchase:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:purchase:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
        </a>
    </@shiro.hasPermission>
   </@table>
  <div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("bpm:purchase:edit")}";
    var listFlag = "${permission.hasPermi("bpm:purchase:add")}";
    var delFlag = "${permission.hasPermi("bpm:purchase:del")}";
    var viewFlag = "${permission.hasPermi("bpm:purchase:view")}";
    var visible = ${permission.isPermitteds("bpm:purchase:edit,bpm:purchase:del,bpm:purchase:add")?string('true', 'false')};
   var orderIsTaxDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var orderIsTransportDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var orderIsGuaranteeDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var carTranmissionDatas = ${dict.getDictListJson('sys_crm_cartranmission')};
   var carDrivertrainDatas = ${dict.getDictListJson('sys_crm_cardrivertrain')};
   var carStatusDatas = ${dict.getDictListJson('sys_crm_carstatus')};
   var channelPurchaseSourceDatas = ${dict.getDictListJson('sys_crm_purchasesource')};
   var channelIsOpenSaleDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var channelAuctionDatas = ${dict.getDictListJson('sys_auction')};
   var channelAuctionTypeDatas = ${dict.getDictListJson('sys_crm_auctiontype')};
   var managerReviewDatas = ${dict.getDictListJson('sys_crm_review')};
   var managerIsPurchaseDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var purchaseResultDatas = ${dict.getDictListJson('sys_result_status')};
   var isWarehousingDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var cashierPayMethodDatas = ${dict.getDictListJson('sys_crm_paymethod')};
   var confirmPayMethodDatas = ${dict.getDictListJson('sys_result_status')};
    var prefix = baseURL + "bpm/purchase";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            viewUrl: prefix + "/view/{id}",
            delUrl: prefix + "/del",
            modalName: "采购订单",
            uniqueId:    'id'/* 唯一ID */                                                                                                                 ,
            escape: true,            /* 分页设置 */
            showPageGo: true,       /* 分页设置 */
            pageSize: 10,            /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            columns: [
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '<@ctx.i18n text = "主键"/>',visible: false}
               ,{field : 'saleCode',title : '<@ctx.i18n text = "订单号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                     ,{field : 'saleUserid',title : '<@ctx.i18n text = "销售员"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'saleOrderNumber',title : '<@ctx.i18n text = "销售订单编号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'orderContractPrice',title : '<@ctx.i18n text = "合同价格"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'orderIsTax',title : '<@ctx.i18n text = "是否含税"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(orderIsTaxDatas, value); }}
               ,{field : 'orderIsTransport',title : '<@ctx.i18n text = "是否包含运输费用"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(orderIsTransportDatas, value); }}
               ,{field : 'orderIsGuarantee',title : '<@ctx.i18n text = "是否保修"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(orderIsGuaranteeDatas, value); }}
              ,{field : 'orderOtherItem',title : '<@ctx.i18n text = "其他"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'carVin',title : '<@ctx.i18n text = "车辆识别号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'carVehicle',title : '<@ctx.i18n text = "车辆"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'carMileage',title : '<@ctx.i18n text = "里程"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'carTranmission',title : '<@ctx.i18n text = "变速箱 "/>',formatter: function(value, row, index) { return $.table.selectDictLabels(carTranmissionDatas, value); }}
               ,{field : 'carDrivertrain',title : '<@ctx.i18n text = "驱动形式"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(carDrivertrainDatas, value); }}
               ,{field : 'carStatus',title : '<@ctx.i18n text = "车况"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(carStatusDatas, value); }}
              ,{field : 'channelHighestPrice',title : '<@ctx.i18n text = "最高价"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'channelPurchaseSource',title : '<@ctx.i18n text = "采购来源"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(channelPurchaseSourceDatas, value); }}
               ,{field : 'channelIsOpenSale',title : '<@ctx.i18n text = "是否公开销售"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(channelIsOpenSaleDatas, value); }}
               ,{field : 'channelAuction',title : '<@ctx.i18n text = "拍卖 "/>',formatter: function(value, row, index) { return $.table.selectDictLabels(channelAuctionDatas, value); }}
               ,{field : 'channelAuctionType',title : '<@ctx.i18n text = "拍卖类型"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(channelAuctionTypeDatas, value); }}
              ,{field : 'channelAuctionTimeType',title : '<@ctx.i18n text = "拍卖时间类型"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'channelAuctionTime',title : '<@ctx.i18n text = "拍卖时间"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'channelSellerName',title : '<@ctx.i18n text = "卖方名称"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'channelSellerContactinfo',title : '<@ctx.i18n text = "卖方联系方式"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'managerPurchaseSpecialist',title : '<@ctx.i18n text = "采购专员"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'managerReview',title : '<@ctx.i18n text = "审查"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(managerReviewDatas, value); }}
                ,{field : 'managerIsPurchase',title : '<@ctx.i18n text = "是否采购"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(managerIsPurchaseDatas, value); }}
               ,{field : 'purchaseResult',title : '<@ctx.i18n text = "采购结果"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(purchaseResultDatas, value); }}
              ,{field : 'purchaseResultTime',title : '<@ctx.i18n text = "结果时间"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                ,{field : 'isWarehousing',title : '<@ctx.i18n text = "是否入库"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(isWarehousingDatas, value); }}
              ,{field : 'cashierPaySentTime',title : '<@ctx.i18n text = "付款发送日期"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'cashierPayMethod',title : '<@ctx.i18n text = "付款方式"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(cashierPayMethodDatas, value); }}
              ,{field : 'cashierProofFilepath',title : '<@ctx.i18n text = "证明"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'cashierReceiptNumber',title : '<@ctx.i18n text = "收据单号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                ,{field : 'confirmPayMethod',title : '<@ctx.i18n text = "支付结果"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(confirmPayMethodDatas, value); }}
              ,{field : 'confirmPayAmount',title : '<@ctx.i18n text = "金额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'purchasePaySum',title : '<@ctx.i18n text = "付款总额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                ,{title:"<@ctx.i18n text = '操作'/>",align: 'center',visible:visible,formatter: function(value, row, index) {
                        var actions = [];
                          actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="showDetial(\'' + row.id + '\')"><i class="fa fa-remove"></i>查看</a>');
                         return actions.join('');
                    }
                }

                ]
            };
            $.table.init(options);
        });
    function showDetial(id) {
        opt.modal.open("查看",prefix+"/view1/"+id);
    }
</script>
</@footer>
</@pageTheme>